package ru.papergames.battleserver.network.serverpackets.webserver;

import org.apache.log4j.Logger;
import ru.papergames.battleserver.model.battle.AbstractBattle;

/**
 * @author: atroshanin
 * Date: 19.06.2010
 * Time: 17:56:53
 */
public class BattleStartNotification extends WebServerServerPacket {

    private static final Logger log = Logger.getLogger(BattleStartNotification.class.getName());

    private AbstractBattle battle;

    public BattleStartNotification(AbstractBattle battle) {
        this.battle = battle;
    }

    @Override
    protected void writePacketId() {
        writeC(BATTLE_START_NOTIFICATION_PACKET_ID);
    }

    @Override
    protected void writePacketData() {
        log.info("BattleStartNotification.writePacketData[" + battle.getBattleOrderId() + "]");
        writeD(battle.getBattleOrderId());
    }

    @Override
    public String getType() {
        return "[s] BattleStartNotification[" + BATTLE_START_NOTIFICATION_PACKET_ID + "]";
    }

}
